package cn.calin.day05.demo41Collections;

import java.util.ArrayList;
import java.util.Collections;

public class Demo01Collections {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        /*往集合中添加多个元素
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");*/

        //public static <T> boolean addAll(Collection<T> c,T...elements):往集合里添加一些元素
        Collections.addAll(list,"a","b","c","d","e");
        System.out.println(list);//[a, b, c, d, e]

        //public static void shuffle(list<?> list)：打乱list集合顺序
        Collections.shuffle(list);
        System.out.println(list);//[b, e, a, c, d]





    }
}
